package com.itheima.wemedia.vo;

import com.itheima.wemedia.pojo.WmNews;
import com.itheima.wemedia.pojo.WmUser;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@Data
public class WmNewsVo extends WmNews {
    //作者名称
    private String authorName;

    public static WmNewsVo build(WmNews wmNews, WmUser wmUser){
        WmNewsVo vo = new WmNewsVo();
        BeanUtils.copyProperties(wmNews, vo);
        vo.setAuthorName(wmUser.getName());
        return vo;
    }
}